package com.ts.content.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ts.common.core.utils.Result;
import com.ts.content.entity.ImgEntity;
import com.ts.content.service.ImgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @version 1.0
 * @auth Administrator
 * @date 2023/3/2
 **/
@RestController
@RequestMapping("/img")
public class ImgController {
    @Autowired
    private ImgService imgService;
    @GetMapping("/list")
    public Result<ImgEntity> list(@RequestParam Integer type){
        QueryWrapper queryWrapper=new QueryWrapper();
        queryWrapper.eq("type",1);
        List list = imgService.list(queryWrapper);
        return new Result().viewOk(list);
    }
}

